Skip to main content

Execute Non Query

AutomatR.OracleDB.Database.ExecuteNonQuery

The "Execute Non Query" activity in AutomatR is designed for executing non-query SQL statements on an Oracle database. This activity is typically used for operations that modify the database, such as insert, update, or delete statements. It requires a valid OracleConnection variable and a SQL query as input.

Properties

NameDescription
Input
ConnectionSpecifies the OracleConnection variable representing the database connection on which the SQL command will be executed. This variable should be obtained from a previous "Connect" activity or a similar source.
Command TextSpecifies the SQL query to be executed as a non-query statement. This query can include insert, update, delete, or other non-query operations. String variables containing the SQL command text.
Misc
Display NameProvides a customizable name for the activity displayed in the workflow. The display name enhances clarity and organization within the automation project. String variables containing the desired display name.
Optional
DelaySpecifies the amount of time (in seconds) to wait before executing the "Execute Non Query" activity. This can be useful for handling synchronization issues. Integer variables containing the delay duration. Ex.: If the amount of time is 1000 milliseconds or 1 sec, i.e., 1.
Command TimeoutSpecifies the amount of time (in milliseconds) to wait for the SQL command to run before throwing an error. If not provided, the default timeout is set to 60 seconds. Integer variables containing the command timeout duration.
Output
ResultOutputs the result of the SQL command, representing the number of rows affected by the non-query operation. The result is stored in an integer variable for further use in the workflow.

How to use:

  1. Drag and drop the "Execute Non Query" activity onto the workflow.
  2. Configure the properties by specifying the OracleConnection variable obtained from a previous "Connect" activity, the SQL command text, and other optional parameters.
  3. Optionally, configure the delay.
  4. Execute the workflow to perform the non-query operation on the Oracle database.

Note:

  • Ensure that the SQL query provided is a valid non-query statement (e.g., INSERT, UPDATE, DELETE, or DDL).
  • The result represents the number of rows affected by the non-query operation and is stored in the specified integer variable.

Example: Consider an example where the "Execute Non Query" activity is used to insert data into an Oracle database:

Execute Non Query:
Connection: oracleConnectionVariable
Command Text: "INSERT INTO Employees (EmployeeID, EmployeeName) VALUES (1, 'John Doe')"
Command Timeout: 5000
Result: rowsAffected

In this example, the activity is configured to execute an insert statement on the "Employees" table, and the number of affected rows is stored in the integer variable "rowsAffected" for further use.